package org.lyj.samples;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class EventBusSenderVerticle extends AbstractVerticle {

    private static final Logger logger = LoggerFactory.getLogger(EventBusSenderVerticle.class);

    private String message;

    public EventBusSenderVerticle(String message) {
        this.message = message;
    }

    @Override
    public void start(Future<Void> startFuture) throws Exception {
        vertx.eventBus().publish("anAddress", "publish " + message);
        vertx.eventBus().send   ("anAddress", "send " + message);
        logger.info("sender start ... " + message);
    }
}
